package com.three.lab.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class GoodsBean implements Parcelable {

    private int id;
    private String name;
    private String des;
    private String goodsUrl;
    private float price;
    private int num;
    private boolean status;
    private boolean collected;

    public GoodsBean() {
    }

    public GoodsBean(int id, String name, String des, String goodsUrl, float price, int num, boolean status, boolean collected) {
        this.id = id;
        this.name = name;
        this.des = des;
        this.goodsUrl = goodsUrl;
        this.price = price;
        this.num = num;
        this.status = status;
        this.collected = collected;
    }

    protected GoodsBean(Parcel in) {
        id = in.readInt();
        name = in.readString();
        des = in.readString();
        goodsUrl = in.readString();
        price = in.readFloat();
        num = in.readInt();
        status = in.readByte() != 0;
        collected = in.readByte() != 0;
    }

    public static final Creator<GoodsBean> CREATOR = new Creator<GoodsBean>() {
        @Override
        public GoodsBean createFromParcel(Parcel in) {
            return new GoodsBean(in);
        }

        @Override
        public GoodsBean[] newArray(int size) {
            return new GoodsBean[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public String getGoodsUrl() {
        return goodsUrl;
    }

    public void setGoodsUrl(String goodsUrl) {
        this.goodsUrl = goodsUrl;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public boolean isCollected() {
        return collected;
    }

    public void setCollected(boolean collected) {
        this.collected = collected;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(name);
        dest.writeString(des);
        dest.writeString(goodsUrl);
        dest.writeFloat(price);
        dest.writeInt(num);
        dest.writeByte((byte) (status ? 1 : 0));
        dest.writeByte((byte) (collected ? 1 : 0));
    }
}
